package com.zte.coding.shape;
/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 14-2-13
 * Time: 下午10:20
 * To change this template use File | Settings | File Templates.
 */
public class Rectangle implements Shape{
    private double length;
    private double height;

    public Rectangle(double length, double height){
        if (length <= 0 || height <= 0){
            return;
        }

        this.length = length;
        this.height = height;
    }

    public double calculateArea() {
        return this.length*this.height;
    }

    public double calculatePerimeter() {
        return (this.length + this.height)*2;
    }

    public void setLength(int length) {
        if (length <= 0)
            return;
        this.length = length;
    }

    public double getLength() {
        return length;
    }

    public void setHeight(int height) {
        if (length <= 0)
            return;
        this.height = height;
    }

    public double getHeight() {
        return height;
    }
}
